<include file="public@header">
<link rel="stylesheet" href="__STATIC__/hybit/css/new_style.css">
<link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
<body>
    <div class="bgbg headhead">
        <p class="mytitle">{:lang("Related trade")}</p>
        <div class="z_gljy">
            <if $user_relation.son == 0>
            <div class="z_gljydiv">
                <h3>{:lang('Master account')}</h3>
                <if cookie('think_var') == 'en-us'>
                    <p>After opening the main account, the sub account associated with you will trade with you when you trade with your main account, which will generate the same benefits for you. If you withdraw the main account, you will automatically disconnect all the linked accounts.</p>
                <else/>
                    <p>开启主账户后与您关联绑定的子账户将与您交易时，跟随您的主账户交易，产生于您相同的收益；开启主账户期间如果产生提币，将自动断开所有关联账号。</p>
                </if>
                <div>
                    <if $user_relation.parent == 1>
                        <a href="{:url('parent_son/parent')}">{:lang('Association list')}</a>
                    </if>
                    &nbsp;
                    <if $user_relation.parent == 0>
                        <a id="parent" data-act="open">{:lang('Open now')} ></a>
                    <else/>
                        <a id="parent" data-act="close">{:lang('Close now')} ></a>
                    </if>
                </div>
            </div>
            </if>
            
            <if $user_relation.parent == 0>
            <div class="z_gljydiv">
                <h3>{:lang('Sub account')}</h3>
                <if cookie('think_var') == 'en-us'>
                    <p>After opening the sub account, the main account can be bound. When the primary account is traded, it will follow your main account to trade, resulting in the same income; if a withdrawal currency is generated during the opening of the sub account, the primary account Association will be automatically disconnected.</p>
                <else/>
                    <p>开启子账户后，可进行绑定主账号。当主账号进行交易时，将跟随您的主账户交易，产生相同的收益；开启子账户期间如果产生提币，将自动断开主账户关联。</p>
                </if>
                <div>
                    <if $user_relation.son == 1>
                        <a href="{:url('parent_son/son')}">{:lang('Association list')}</a>
                    </if>
                    &nbsp;
                    <if $user_relation.son == 0>
                        <a id="son" data-act="open">{:lang('Open now')} ></a>
                    <else/>
                        <a id="son" data-act="close">{:lang('Close now')} ></a>
                    </if>
                </div>
            </div>
            </if>

            <div class="z_gljynote">
                <h3>*{:lang('Instructions for use')}</h3>
                <if cookie('think_var') == 'en-us'>
                    <p>1.When binding a sub account,the fund of the sub account should not be less than that of the main account.</p>
                    <p>2.Binding the main account to follow the transaction is your subjective will, and the risk is borne by the user.</p>
                    <p>3.Related party transaction assets are limited to usdt.</p>
                <else/>
                    <p>1.绑定子账户时，子账户资金需不小于主账户；</p>
                    <p>2.绑定主账户跟随交易为您的主观意愿，风险由用户个人承担。</p>
                    <p>3.关联交易资产仅限于USDT。</p>
                </if>
            </div>
        </div>
    </div>
</body>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
layui.use(['form','layer'],function(){
    var layer = layui.layer,
        form = layui.form;

    $('#parent').click(function(){
        var act = $(this).data('act');
        layer.msg('{:lang("Confirm the operation")}?', {
            shade:0,
            time:0,
            btn: ['{:lang("Confirm")}', '{:lang("Cancel")}'],
            btn1:function(index,layero){
                $.ajax({
                    type: 'post',
                    url: '{:url("parent_son/parent")}',
                    data:{act:act},
                    success:function(res){
                        layer.msg(res.msg);
                        if(res.code == 1){
                            setTimeout(function(){ location.reload(); }, 1500);
                        }
                    }
                });
            },
        });
    });

    $('#son').click(function(){
        var act = $(this).data('act');
        layer.msg('{:lang("Confirm the operation")}?', {
            shade:0,
            time:0,
            btn: ['{:lang("Confirm")}', '{:lang("Cancel")}'],
            btn1:function(index,layero){
                $.ajax({
                    type: 'post',
                    url: '{:url("parent_son/son")}',
                    data:{act:act},
                    success:function(res){
                        layer.msg(res.msg);
                        if(res.code == 1){
                            setTimeout(function(){ location.reload(); }, 1500);
                        }
                    }
                });
            },
        });
    });
});
</script>
</html>